package com.aaa.controller;
import com.aaa.entity.Forderp;
import com.aaa.entity.ResultMsg;
import com.aaa.service.ForderServiceDao;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("forderss")
public class ForderController {
    @Resource
    ForderServiceDao forderServiceDao;

    @RequestMapping("add")//购买图书
    public ResultMsg add(Forderp forderp){
        return ResultMsg.success(forderServiceDao.save(forderp));
    }
    @RequestMapping("find")//查询订单
    public ResultMsg find(Integer uid){
        return ResultMsg.success(forderServiceDao.find(uid));
    }
    @RequestMapping("del")//删除订单
    public ResultMsg del(Integer id){
        return ResultMsg.success(forderServiceDao.removeById(id));
    }

}
